//
//  KeyBoard.m
//  OralRobot
//
//  Created by 王桂敏 on 2016/10/20.
//  Copyright © 2016年 wangguimin. All rights reserved.
//

#import "KeyBoard.h"

@implementation KeyBoard

+ (instancetype)sharedInstance
{
    static KeyBoard* instance = nil;
    
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [KeyBoard new];
    });
    
    return instance;
}


- (void)keyboardDidShow
{
    self.keyboardIsVisible = YES;
}

- (void)keyboardDidHide
{
    self.keyboardIsVisible = NO;
}


- (instancetype)init {
    self = [super init];
    if (self) {
        NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
        [center  addObserver:self selector:@selector(keyboardDidShow)  name:UIKeyboardDidShowNotification  object:nil];
        [center addObserver:self selector:@selector(keyboardDidHide)  name:UIKeyboardWillHideNotification object:nil];
        self.keyboardIsVisible = NO;
    }
    return self;
}



@end
